#include <iostream>
using namespace std;

int main() {
	int n;
	cin >> n;
	while (n) {
		int a, b, c;
		a = n / 100;
		b = n / 10 % 10;
		c = n % 10;
		if (n == a * a * a + b * b * b + c * c * c)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
		cin >> n;
	}
	return 0;
}
